package com.atguigu.wordcount.reducerjoin;

import org.apache.hadoop.io.Writable;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

/**
 * @ClassName JoinBean
 * @DeScription JoinBean
 * @Author 剧情再美终是戏
 * @Date 2019/11/20 11:33
 * @Version 1.0
 **/
public class JoinBean implements Writable {

    private String orderId;

    private String pId;

    private String pName;

    private String aMount;

    private String source;

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getpId() {
        return pId;
    }

    public void setpId(String pId) {
        this.pId = pId;
    }

    public String getpName() {
        return pName;
    }

    public void setpName(String pName) {
        this.pName = pName;
    }

    public String getaMount() {
        return aMount;
    }

    public void setaMount(String aMount) {
        this.aMount = aMount;
    }

    public String getSource() {
        return source;
    }

    public void setSource(String source) {
        this.source = source;
    }

    @Override
    public String toString() {
        return orderId + "\t" + pName + "\t" + aMount;
    }

    public void write(DataOutput out) throws IOException {
        out.writeUTF(orderId);
        out.writeUTF(pId);
        out.writeUTF(pName);
        out.writeUTF(aMount);
        out.writeUTF(source);
    }

    public void readFields(DataInput in) throws IOException {
        orderId = in.readUTF();
        pId = in.readUTF();
        pName = in.readUTF();
        aMount = in.readUTF();
        source = in.readUTF();
    }
}
